<div class="navbar navbar-default navbar-fixed-top" ng-controller="NavbarCtrl">
  <div class="container">
    <div class="navbar-header">
      <button class="navbar-toggle" type="button" ng-click="isCollapsed = !isCollapsed">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="/" class="navbar-brand">鸿茂OA</a>
    </div>
    <div collapse="isCollapsed" class="navbar-collapse collapse" id="navbar-main">
      <ul class="nav navbar-nav">
        <li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}">
            <a ng-href="{{item.link}}"><i class="{{item.icon}}"></i> {{item.title}}</a>
        </li>
        <li class="dropdown" dropdown on-toggle="toggled(open)" ng-show="isAdmin()">
          <a href class="dropdown-toggle" dropdown-toggle>
            人事管理 <span class="caret"></span>
          </a>
          <ul class="dropdown-menu">
            <li>
              <a ui-sref="app.admin-users">人员管理</a>
            </li>
            <li>
              <a ui-sref="app.admin-departments">部门管理</a>
            </li>
          </ul>
        </li>
      </ul>

      <ul class="nav navbar-nav navbar-right">
        <li ng-hide="isLoggedIn()" ng-class="{active: isActive('/signup')}"><a href="/signup">注册</a></li>
        <li ng-hide="isLoggedIn()" ng-class="{active: isActive('/login')}"><a href="/login">登入</a></li>
        <li ng-show="isLoggedIn()"><p class="navbar-text">欢迎你 {{ getCurrentUser().name }}</p> </li>
        <li ng-show="isLoggedIn()" ng-class="{active: isActive('/settings')}"><a href="/settings"><span class="glyphicon glyphicon-cog"></span></a></li>
        <li ng-show="isLoggedIn()" ng-class="{active: isActive('/logout')}"><a href="" ng-click="logout()">登出</a></li>
      </ul>
    </div>
  </div>
</div>
